<!DOCTYPE html>
<html>
<head>
<title>用户注册登录</title>
<link rel="stylesheet" href="css/reset.css" />
<link rel="stylesheet" href="css/user.css" />
<script src="js/jquery.min.js"></script>
<script src="js/user.js"></script>
</head>
<body>
<div class="page">
<div class="loginwarrp">
<div class="logo">用户注册登录</div>
<div class="login_form">
<div>
<li class="login-item">
    <span>用户名：</span>
    <input type="text" id="username" class="login_input">
    <span id="count-msg" class="error"></span>
</li>
<li class="login-item">
    <span>密　码：</span>
    <input type="password" id="password" class="login_input">
    <span id="password-msg" class="error"></span>
</li>
<li class="login-item">
    <span>新密码：</span>
    <input type="password" id="password2" class="login_input">
    <span id="password-msg" class="error"></span>
</li>

<li class="login-sub">
    <input type="submit" id="submits" value="注册/登录">
</li>
</div>
<br>
<li class="login-sub">
    <a id="getUser" href="javascript:;" target="_blank">查看用户信息</a>
</li>
</div>
</div>
</div>
<script type="text/javascript">
$("#submits").on('click',function(){
var datas = {
    "username": $("#username").val(),
    "password": $("#password").val(),
};
var password2 = $("#password2").val();
if (datas.password==password2){
    $.post("http://127.0.0.1:8000/users/",datas, function(data,status){
        if (status=="success") {
            console.log(data);
            $("#getUser").attr("href","http://127.0.0.1:8000/userInfo/?token=" + data.token);
        }
    });
}else{
    alert("输入的密码不一致")
}
});
</script>
<script type="text/javascript">
	window.onload = function() {
		var config = {
			vx : 4,
			vy : 4,
			height : 2,
			width : 2,
			count : 100,
			color : "121, 162, 185",
			stroke : "100, 200, 180",
			dist : 6000,
			e_dist : 20000,
			max_conn : 10
		};
		CanvasParticle(config);
	}
</script>
<script src="js/canvas-particle.js"></script>
</body>
</html>
